package com.scy.java.object.stad;

import java.time.LocalDateTime;

public class User {
    private Long userName;
    private String password;
    private LocalDateTime createTime;
     {
        System.out.println("新用户注册");
        createTime=LocalDateTime.now();
    }

    public Long getUsername() {
        return userName;
    }

    public void setUsername(Long username) {
        this.userName = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public User() {
        /**
         * 无参构造。
         */
//        System.out.println("新用户注册");
//        createTime=LocalDateTime.now();
        userName=System.currentTimeMillis();
        password="1811239";
    }

    public User(Long username, String password) {
        /**
         * 有参构造。
         */
//        System.out.println("新用户注册");
//        createTime=LocalDateTime.now();
        this.userName = username;
        this.password = password;
    }

    @Override
    public String toString() {
        return "User{" +
                "userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
